import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import viteStylelint from '@amatlash/vite-plugin-stylelint'
import viteEslint from 'vite-plugin-eslint'
import { myVitePlugin } from './Plugin'
import virtual from './plugins/virtual-module'
import requireTransform from 'vite-plugin-require-transform'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    viteEslint(),
    viteStylelint({
      // 对某些文件排除检查
      exclude: /windicss|node_modules/,
    }),
    myVitePlugin({ name: 'xxx' }),
    virtual(),
    requireTransform({
      fileRegex: /.ts$|.tsx$|.vue$/,
    }),
  ],
  build: {
    sourcemap: true,
    minify: false,
  },
})
